/*数据库相关函数*/

void do_insert(sqlite3 *db) {

	char *errmsg;
	char cmd[256];
	
	sprintf(cmd, "insert into w0_history values(%s, '%s', %d, %d, %d, %d, %d, %d, %d, %d)", head, type, snum, temp, hum, ill, x, y, z, bet, adc);

	if(sqlite3_exec(db, cmd,  NULL,  NULL, &errmsg) !=  SQLITE_OK) {
		
		printf("error:%s\n",  errmsg);
		return;
		
	} else {
		
		puts("insert ok");
		
	}
}
